package com.jeesite.modules.merchant.entity;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.entity.TreeEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.modules.car.entity.Car;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

@Table(name="h_merchant", alias="a", label="商户入驻表信息", columns={
        @Column(name="id", attrName="id", label="主键id", isPK=true),
        @Column(name="user_id", attrName="userId", label="关联的用户表id"),
        @Column(name="name", attrName="name", label="商户名称", queryType=QueryType.LIKE),
        @Column(name="director", attrName="director", label="负责人", queryType=QueryType.LIKE),
        @Column(name="phone", attrName="phone", label="负责人电话"),
        @Column(name="place", attrName="place", label="商家地点"),
        @Column(name="license_url", attrName="licenseUrl", label="营业执照路径"),
        @Column(name="logo_url", attrName="logoUrl", label="logo路径"),
        @Column(name="review_status", attrName="reviewStatus", label="审核状态", comment="【0：未审核，1：通过，2：驳回】"),
        @Column(name="create_by", attrName="createBy", label="创建者", isUpdate=false, isQuery=false),
        @Column(name="create_date", attrName="createDate", label="创建时间", isUpdate=false, isQuery=false),
        @Column(name="update_by", attrName="updateBy", label="更新者"),
        @Column(name="update_date", attrName="updateDate", label="更新时间"),
        @Column(name="remarks", attrName="remarks", label="备注信息"),
}, orderBy="a.update_date DESC"
)
public class Merchant extends DataEntity<Merchant> {

    private static final long serialVersionUID = 1L;

    /**
     * 关联的用户id
     */
    private String userId;

    /**
     * 商户名称
     */
    private String name;

    /**
     * 负责人
     */
    private String director;

    /**
     * 电话
     */
    private String phone;

    /**
     * 商户地址
     */
    private String place;

    /**
     * 营业执照路径
     */
    private String licenseUrl;

    /**
     * logo
     */
    private String logoUrl;

    /**
     * 审核状态【0：未审核，1：通过，2：驳回】
     */
    private String reviewStatus;

    public Merchant() {
        this(null);
    }

    public Merchant(String id){
        super(id);
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @NotBlank(message="商户名称不能为空")
    @Size(min=0, max=64, message="商户名称长度不能超过 64 个字符")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @NotBlank(message="负责人不能为空")
    @Size(min=0, max=64, message="负责人长度不能超过 64 个字符")
    public String getDirector() {
        return director;
    }

    public void setDirector(String director) {
        this.director = director;
    }

    @NotBlank(message="联系电话不能为空")
    @Size(min=0, max=64, message="联系电话长度不能超过 64 个字符")
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Size(min=0, max=255, message="营业执照长度不能超过 255 个字符")
    public String getLicenseUrl() {
        return licenseUrl;
    }

    public void setLicenseUrl(String licenseUrl) {
        this.licenseUrl = licenseUrl;
    }

    public String getReviewStatus() {
        return reviewStatus;
    }

    public void setReviewStatus(String reviewStatus) {
        this.reviewStatus = reviewStatus;
    }

    @NotBlank(message="商家地点不能为空")
    @Size(min=0, max=64, message="商家地点长度不能超过 64 个字符")
    public String getPlace() {
        return place;
    }

    public void setPlace(String place) {
        this.place = place;
    }

    @Size(min=0, max=255, message="LOGO长度不能超过 255 个字符")
    public String getLogoUrl() {
        return logoUrl;
    }

    public void setLogoUrl(String logoUrl) {
        this.logoUrl = logoUrl;
    }
}
